/***************************************************************************
* DBhistory.h
* This header file contains information related to old DB versions
* Copyright (C) 2009 by Honeywell Security
* See COPYRIGHT for license information.
***************************************************************************/

#ifndef __DBHISTORY__
#define __DBHISTORY__

#include "intTypes.h"

//---------------------------------------------------------------
//Version 16 database is the first version that we are converting
//---------------------------------------------------------------
//V16.0 Record Size
#define 	v16SizeofAccessLevelRecord	39
#define     v16SizeofTimeZoneRecord 	46
#define     v16SizeofCardFormatRecord 	118
#define     v16SizeofHolidayRecord	49
#define     v16SizeofSiteCodeRecord	39
#define     v16SizeofRoomRecord	177

#define     v16SizeofAccessLevelDeviceRecord	66
#define     v16SizeofDeviceRecord	52
#define     v16SizeofInputRecord	62
#define     v16SizeofInterlockRecord	46
#define     v16SizeofOutputRecord	44
#define     v16SizeofOutputGroupRecord	60
#define     v16SizeofPanelConfigurationRecord	157
#define     v16SizeofPSOCConfigurationRecord	42
#define     v16SizeofReaderRecord	145

//V16.0 Number of records
#define 	v16NumAccessLevelRecords 128
#define     v16NumTimeZoneRecords  127
#define     v16NumCardFormatRecords  128
#define     v16NumHolidayRecords  255
#define     v16NumSiteCodeRecords  8
#define     v16NumRoomRecords   62

#define     v16NumAccessLevelDeviceRecords 128
#define     v16NumDeviceRecords  16
#define     v16NumInputRecords  128
#define     v16NumInterlockRecords  256
#define     v16NumOutputRecords  128
#define     v16NumOutputGroupRecords  64
#define     v16NumPanelConfigurationRecords  1
#define     v16NumPSOCConfigurationRecords  14
#define     v16NumReaderRecords  4

//V16.0 AccessLevelRecord
// NOTE!!! note the packed attribute - verrrry important, C will do padding if
// the ints (UINT16) do not start on boundaries!!!
struct	v16AccessLevelDeviceRecord
{
	UINT16		f_RecordID;
	UINT8		f_AccessMode;
	UINT8		f_ReaderModes[4];
	UINT16		f_Inputs[4];
	UINT16		f_Outputs[4];
	UINT16		f_OutputTypes[4];
	UINT16		f_TimeZones[4];
	UINT8		f_Name[26];
	UINT8		f_UpdateCounter;
}__attribute__ ((__packed__)) ;

#endif	//__DBHISTORY__
